#include <bits/stdc++.h>
using namespace std;
const int size = 10;
void count_sort(int a[],int len){
  vector<int> res;
  int maxnum = -2147483648;
   for(int i=0;i<len;i++){
    if (a[i]>maxnum) maxnum = a[i];
  }
  
  int *arr = new int[maxnum+1];
  for(int i=0;i<maxnum+1;i++) arr[i]=0;
  for(int i=0;i<len;i++){
    arr[a[i]]++;
  }


  int pos = 0;
  for(int i=0;i<maxnum+1;i++){
    int cnt = arr[i];
    for(int j=0;j<cnt;j++){
      a[pos++] = i;
    }
  }
}
int main() {
  int a[size] = {8,8,8,9,9,1,1,4,5,5};
   count_sort(a,size);
  for(int i=0;i<size;i++){
    cout<<a[i]<<" ";
  }
  return 0;
}